The police and the military are pretty touchy in Yining. No taking photographs of mosques and obviously don't take pictures of the military. The hassle is mainly due to them being confused how to deal with foreigners - best option seems to be to ask them to take you to your hotel, who can clear things up in about a minute.